<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" 	prefix="s"%>
<%@ include file="/jsp/common/common_head.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<title>示界港管理平台</title>
<%@ include file="/jsp/common/common_script.jsp"%>
<style type="text/css">
</style>
<script type="text/javascript">
 var g_userId = '<%=session.getAttribute("userId")%>';
</script>
</head>
<body>
<table class="queryTable" >
	<tr>
		<td class="queryTitle" width="68px">活动分类</td>
		<td class="queryContent">
			<select id="boType" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
			</select>
		</td>
		<td class="queryTitle" width="68px">活动状态</td>
		<td class="queryContent">
			<select id="boState" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
			</select>
		</td>
		<td class="queryTitle" width="68px">发布状态</td>
		<td class="queryContent">
			<select id="boPublish" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px">
			</select> 
		</td>
		<td class="queryTitle" width="68px">活动标题</td>
		<td class="queryContent">
			<input class="inputText" type="text" style="width:120px" id="queryTitle" />
		</td>
		<td class="queryBtnTd">
			<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search"  onclick="doQuery(1)">查询</a>
		</td>
	</tr>
</table>

<table id="actInfoGrid"></table>

<!-- 活动商品信息 -->
<div id="actItemDlg" class="easyui-window" title="" closed="true" style="width:1080px;height:620px;text-align:center; background: #fff;">
		<form id="aItemForm"  method="POST" style="width:1040px;height:550px;padding-left:10px;padding-right:10px;">
			<s:hidden name="act_id" id="act_id"/>
			<div>
				<table border="0" class="queryTable" height="auto">
					 <tr>
						<td class="queryTitle" width="68px"><span style="color:red;">活动ID</span></td>
						<td class="queryContent">
							<span id="pActId" style="width:80px;color: green;" align="center"></span>
						</td>
						<td class="queryTitle" width="68px"><span style="color:red;">活动标题</span></td>
						<td class="queryContent">
							<span id="pTitle" style="width:300px;color:green;"></span>
						</td>
					</tr>
				</table>
			</div>
			<div style="width:1040px;height:520px;">
				<table id="actItemGrid"></table>
			</div>
		</form>
</div>

<!-- 订单 -->
<div id="orderDlg" class="easyui-window" title="" closed="true" style="width:428px; height:auto;text-align:center; background: #fff;">
	<div border="false" style="padding-left:20px;">
		<form id="orderForm"  method="POST">
			<s:hidden name="orderStId" id="orderStId"/>
			<table border="0" class="queryTable" width="95%" height="auto" style="margin-bottom:0px;" id="orderTable">
				<tr>	
					<td class="queryTitle" width="80px">显示顺序</td>
					<td class="queryContent">
						<s:textfield id="order" name="order" cssClass="inputText easyui-validatebox" data-options="" onkeyup="value=value.replace(/[^\d]/gi,'')" cssStyle="width:250px"/>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="orderBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doUpdOrder()">确定</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelUpdOrder()">取消</a>
    </div>
</div>

<!-- 新建活动 -->
<div id="editDlg" class="easyui-window" title="" closed="true" style="width:720px; height:450px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="editForm"  method="POST">
			<s:hidden name="actId" id="actId"/>
			<table border="0" class="queryTable" width="96%" height="auto" style="margin-bottom:0px;" id="editTable">
				<tr>
					<td class="queryTitle" width="80px"><span style="color:red;">活动分类</span></td>
					<td class="queryContent" colspan="6">
						<select id="editType" name="editType" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
						</select>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px"><span style="color:red;">标题</span></td>
					<td class="queryContent" colspan="6">
						<input id="editTitle" name="editTitle"  data-options="required:true,validType:['maxLength[100]']" class="inputText easyui-validatebox" type="text" style="width:500px" id="editTopicTitle" maxlength="15" />
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px">链接地址</td>
					<td class="queryContent" colspan="6">
						<input class="inputText" type="text" style="width:500px" id="actUrl" />
					</td>
				</tr>
				<tr>	
					<td class="queryTitle width="68px"><span style="color:red">活动开始时间</span></td>
					<td class="queryContent" colspan="3">
						<input class="easyui-datetimebox" id="queryDateStart" data-options="required:true,showSeconds:true" style="width:150px">
					</td>
					<td class="queryTitle width="68px"><span style="color:red">活动结束时间</span></td>
					<td class="queryContent" colspan="3">
						<input class="easyui-datetimebox" id="queryDateEnd" data-options="required:true,showSeconds:true" style="width:150px">
					</td>
				</tr>
				<tr>	
					<td class="queryTitle" width="100px">描述</td>
					<td class="queryContent" colspan="6">
						<textarea id="editDesc" name="editDesc" maxlength="100" rows="5" cols="55" style="width:100%;resize:none;"></textarea>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px" height="100px">活动配图</td>
					<td class="queryContent" colspan="5">
						<div style="display:table;text-align:center;height:100px;width:200px">
	        				<span style="display:table-cell;vertical-align:middle" id="editItemThumb">
	        				</span>
	        			</div>
					</td>
					<td class="queryContent">
						<a class="easyui-linkbutton" id="selImgFile" iconCls="icon-add" href="javascript:void(0)" >选择图像</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="editBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doEdit()">确定</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelEdit()">取消</a>
    </div>
</div>

<!-- 新建活动商品 -->
<div id="addActItemDlg" class="easyui-window" title="" closed="true" style="width:620px; height:400px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="itemActForm"  method="POST">
			<s:hidden name="itActId" id="itActId"/>
			<s:hidden name="rId" id="rId"/>
			<table border="0" class="queryTable" width="96%" height="auto" style="margin-bottom:0px;" id="itemActTable">
				<tr>
					<td class="queryTitle" width="100px"><span style="color:blue;">商品ID</span></td>
					<td class="queryContent" colspan="3">
						<input class="easyui-textbox" id="itemId" style="width:150px;">
					</td>
					<td class="queryContent" colspan="2">
						<a class="easyui-linkbutton" id="showItemBtn" iconCls="icon-add" href="javascript:void(0)" onclick="showItem()">选择商品</a>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px"><span style="color:blue;">商品套餐ID</span></td>
					<td class="queryContent" colspan="3">
						<input class="easyui-textbox" id="ppId" style="width:150px;">
					</td>
					<td class="queryContent" colspan="2">
						<a class="easyui-linkbutton" iconCls="icon-add" href="javascript:void(0)" onclick="showPP()">选择商品套餐</a>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px"><span style="color:blue;">套餐数量价格</span></td>
					<td class="queryContent" colspan="3">
						<input class="easyui-textbox" id="ppMin" style="width:80px;">
						<input class="easyui-textbox" id="ppUnit" style="width:60px;">
					</td>
					<td class="queryContent" colspan="2">
						<a class="easyui-linkbutton" iconCls="icon-add" href="javascript:void(0)" onclick="showPpPrice()">选择套餐数量</a>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px"><span style="color:red;">活动价(单位分)</span></td>
					<td class="queryContent" colspan="2">
						<input id="actPrice" name="actPrice" data-options="required:true,validType:['maxLength[20]']" class="inputText easyui-validatebox" type="text" style="width:120px" id="editTopicTitle" maxlength="15" />
					</td>
					<td class="queryTitle" width="100px"><span style="color:green;">原价(单位分)</span></td>
					<td class="queryContent" colspan="2">
						<input id="orgPrice" name="orgPrice" data-options="required:true,validType:['maxLength[20]']" class="inputText easyui-validatebox" type="text" style="width:120px" id="editTopicTitle" maxlength="15" />
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px"><span style="color:red;">商品数量</span></td>
					<td class="queryContent" colspan="2">
						<input id="itemQty" name="itemQty" data-options="required:true,validType:['maxLength[20]']" class="inputText easyui-validatebox" type="text" style="width:120px" id="editTopicTitle" maxlength="15" />
					</td>
					<td class="queryTitle" width="100px"><span style="color:green;">剩余数量</span></td>
					<td class="queryContent" colspan="2">
						<input id="restQty" name="restQty" data-options="required:true,validType:['maxLength[20]']" class="inputText easyui-validatebox" type="text" style="width:120px" id="editTopicTitle" maxlength="15" />
					</td>
				</tr>
				<tr>	
					<td class="queryTitle width="68px"><span style="color:red">截止时间</span></td>
					<td class="queryContent" colspan="5">
						<input class="easyui-datetimebox" id="expiryDate" data-options="required:true,showSeconds:true" style="width:180px">
					</td>
				</tr>
				<tr>	
					<td class="queryTitle" width="100px">描述</td>
					<td class="queryContent" colspan="5">
						<textarea id="actItemDesc" name="actItemDesc" maxlength="100" rows="5" cols="55" class="inputText easyui-validatebox" style="width:100%;resize:none;"></textarea>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="itemActBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="addActItem()">确定</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="celaddActItem()">取消</a>
    </div>
</div>

<!-- 商品详情 -->
<div id="itemDlg" class="easyui-window" closed="true" style="width:1010px;height:600px;text-align:center; background: #fff;">
	 <div style="padding-left:10px;padding-right:10px;">
	 <form id="itemForm"  method="POST">
		<table class="queryTable"  id="itemTable">
				<tr>
					<td class="queryTitle" width="68px">商品大分类</td>
					<td class="queryContent">
						<select id="queryTypeL" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
						</select>
					</td>
					<td class="queryTitle" width="68px">商品中分类</td>
					<td class="queryContent">
						<select id="queryTypeM" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
						</select>
					</td>
					<td class="queryTitle" width="68px">商品小分类</td>
					<td class="queryContent">
						<select id="queryTypeS" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px">
						</select> 
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="68px">商品编码</td>
					<td class="queryContent">
						<input class="inputText" type="text" style="width:120px" id="queryItemNo" />
					</td>
					<td class="queryTitle" width="68px">商品名称</td>
					<td class="queryContent">
						<input class="inputText" type="text" style="width:120px" id="queryItemName" />
					</td>
					<td class="queryTitle" width="68px">关联模版ID</td>
					<td class="queryContent">
						<input class="inputText" type="text" style="width:120px" id="queryTmplId" />
					</td>
					<td class="queryBtnTd">
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search"  onclick="doQuery1(1)">查询</a>
					</td>
				</tr>
		</table>
		<div style="width:980px;height:400px;">
			<table id="itemsGrid"></table>
		</div>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="itemBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="chkItem()">确定</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="celchkItem()">取消</a>
    </div>
</div>

<!-- 单个商品套餐-->
<div id="PpDlg" class="easyui-window" closed="true" style="width:500px;height:450px;text-align:center; background: #fff;">
	 <form id="PpForm"  method="POST">
		 <div style="padding-left:10px;padding-right:10px;">
			<div style="width:470px;height:350px;">
				<table id="ppGrid"></table>
			</div>
		</div>
	</form>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="ppBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="chkPP()">确定</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelChkPP()">取消</a>
    </div>
</div>

<!-- 单个套餐数量计量-->
<div id="PpPriceDlg" class="easyui-window" closed="true" style="width:500px;height:450px;text-align:center; background: #fff;">
	<form id="PpPrForm"  method="POST">
	 <div style="padding-left:10px;padding-right:10px;">
		<div style="width:470px;height:350px;">
			<table id="ppPriceGrid"></table>
		</div>
	</div>
	</form>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="priceBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="chkPpPrice()">确定</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelChkPrice()">取消</a>
    </div>
</div>

<script type="text/javascript" src="${ctx}/js/tg/uploadcom.js"></script>
<script type="text/javascript" src="${ctx}/js/tg/ajaxupload.js"></script>
<script type="text/javascript" src="${ctx}/js/trade/activityInfo.js"></script>
<script type="text/javascript" src="${ctx}/js/encrypt/encrypted-min.js"></script>
</body>
</html>
